package com.fjzx.androidframe.base.annotation.injector;

import com.fjzx.androidframe.base.annotation.ViewModel;

/**
 * ViewModel注解处理器
 */
public class ViewModelInjector {
    public static <T> Class<T> inject(Object t) {
        Class<?> clazz = t.getClass();
        if (clazz.isAnnotationPresent(ViewModel.class)) {
            Class<?> fetcherClass = clazz.getAnnotation(ViewModel.class).value();
            return (Class<T>) fetcherClass;
        }
        return null;
    }
}
